using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.ICM
{
	[DataContract, Table("IcmMasResourceSubGroup")]
    public class MasResourceSubGroup
    {
        public MasResourceSubGroup()
        {
            //this.MasResourceItems = new HashSet<MasResourceItem>();
        }
    

		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "ResSubGrpId", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public int ResSubGrpId { get; set; }

		[DataMember, Display(Name = "Code", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public string Code { get; set; }

		[DataMember, Display(Name = "OldCode", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public string OldCode { get; set; }

		[DataMember, Display(Name = "Name", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public string Name { get; set; }

		[DataMember, Display(Name = "Descr", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public string Descr { get; set; }

        [ForeignKey("MasResourceGroup")]
		[DataMember, Display(Name = "ResGrpId", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public Nullable<int> ResGrpId { get; set; }

		[DataMember, Display(Name = "UnspscCode", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public string UnspscCode { get; set; }

		[DataMember, Display(Name = "IncCode", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public string IncCode { get; set; }

        [ForeignKey("MasDepreciationType")]
		[DataMember, Display(Name = "DpTypeId", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public Nullable<int> DpTypeId { get; set; }

		[DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public string RecordStatus { get; set; }

		[DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public Nullable<int> CreatedBy { get; set; }

		[DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

		[DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public Nullable<int> UpdatedBy { get; set; }

		[DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.MasResourceSubGroupResource))]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        //[DataMember]
        //public virtual ICollection<MasResourceItem> MasResourceItems { get; set; }

        [DataMember]
        public virtual MasResourceGroup MasResourceGroup { get; set; }

        [DataMember]
		public virtual MasDepreciationType MasDepreciationType { get; set; }
        
	    [DataMember, NotMapped] public int AmountOfItem { get; set; } // ViewModel
    }
}